package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class AddNewsDao {
	public boolean addnews(String content,String username) throws ClassNotFoundException, SQLException {
		Connection conn = DBUtil.getConnection();
		PreparedStatement ps = conn.prepareStatement("insert into News(username,content) values(?,?)");
		ps.setString(2, username);
		ps.setString(1,content);
		ps.execute();
		boolean res = true;
		ps.close();
		conn.close();
		System.out.println(res);
		return res;
		
	}
}
